<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page language="java" import="java.util.*,data.UserInfo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>User Information</title>
<style type="text/css">

    #Profile {
            position:absolute;
            width:188px;
            height:436px;
            z-index:1;
            left: 2px;
            top: 187px;
            font-size: small;
    }
    .Text{
            font-size:small;
            }
    #UserList {
            position:absolute;
            width:800px;
            height:387px;
            z-index:2;
            left: 146px;
            top: 141px;
            font-size: small;
            font-style: normal;
            line-height: normal;
    }
    #Header {
            position:absolute;
            width:99%;
            height:48px;
            z-index:3;
            top: 6px;
            left: 4px;
    }
    #HelloUser {
            position:relative;
            width:130px;
            height:22px;
            z-index:1;
            float: right;
            top: 2px;
    }
    #uslstLabel {
            position:absolute;
            width:430px;
            height:30px;
            z-index:4;
            left: 192px;
            top: 162px;
    }
    #Body {
            position:absolute;
            width:751px;
            height:721px;
            z-index:1;
            left: -7px;
            top: -34px;
    }
    #rightPane {
            position:absolute;
            width:182px;
            height:656px;
            z-index:1;
            left: 570px;
            top: 32px;
    }
    .noneDisplay{
        display: none;
    }
	.red{
		color:#FF0000;
	}
    .font{
        font-size: small;
    }
	.small-font{
		font-size:x-small;
		padding-left:0px;
	}

.style13 {font-size: 16px; font-weight: bold; }
.style14 {font-size: 16px}
.style15 {color: #FFF}

#errSPU {
	position:absolute;
	width:600px;
	height:31px;
	z-index:5;
	left: 480px;
	top: 340px;
}
#errCT {
	position:absolute;
	width:600px;
	height:28px;
	z-index:6;
	left: 480px;
	top: 370px;
}
#errIT {
	position:absolute;
	width:600px;
	height:24px;
	z-index:7;
	left: 480px;
	top: 400px;
}
.style7 {font-size: 40px}
.style8 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 16px;
	font-style: italic;
}
#Layer2 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:4;
	left: 96px;
	top: 192px;
}
</style>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
@import url("css/tablestyle.css");
</style>
<style type="text/css">
<!--

img {
border: none;
}
#tabsG {
      float:left;
      width:100%;
      background:#FFFFF;
      font-size:93%;
      line-height:normal;
      }
    #tabsG ul {
        margin:0;
        padding:10px 10px 0 50px;
        list-style:none;
      }
    #tabsG li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsG a {
      float:left;
      background:url("images/tableftG.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsG a span {
      float:left;
      display:block;
      background:url("images/tabrightG.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#FFF;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsG a span {float:none;}
    /* End IE5-Mac hack */
    #tabsG a:hover span {
      color:#FFF;
      }
    #tabsG a:hover {
      background-position:0% -42px;
      }
    #tabsG a:hover span {
      background-position:100% -42px;
      }

	#tabsG #current a {
			background-position:0% -42px;
	}
	#tabsG #current a span {
			background-position:100% -42px;
	}

</style>
</head>
<body>
<script src="javascript/jquery.min.js"></script>
   <script>
        function setvalue(radio,field){
            var value = document.getElementById(radio).value;
            //alert(value);
            document.getElementById(field).value = value;
            $("#"+field).attr("readonly",true);
        }
        function doAll(target, field, err){
            $("#"+target).click(function(){
                setvalue(target,field);
                $("#"+err).fadeOut(1000);
            });
        }
        $(document).ready(function(){
            $("#spu").focusout(function(){
                var spu = document.getElementById("spu").value;
                //alert(spu);
                var int_spu = parseInt(spu);
                if(isNaN(int_spu)){
                    $("#errSPU").css("display","inline");
                }else if(0 > int_spu){
                    $("#errSPU").text("Session_per_user cannot be negative!");
                }else{
                    $("#errSPU").fadeOut(1000);
                }
            });
            $("#ct").focusout(function(){
                var ct = document.getElementById("ct").value;
                //alert(spu);
                var int_ct = parseInt(ct);
                if(isNaN(int_ct)){
                    $("#errCT").css("display","inline");
                }else if(0 > int_ct){
                    $("#errCT").text("Connect_time cannot be negative!");
                }else{
                    $("#errCT").fadeOut(1000);
                }
            });
            $("#it").focusout(function(){
                var it = document.getElementById("it").value;
                //alert(spu);
                var int_it = parseInt(it);
                if(isNaN(int_it)){
                    $("#errIT").css("display","inline");
                }else if(0 > int_it){
                    $("#errSPU").text("Idle_time cannot be negative!");
                }else{
                    $("#errIT").fadeOut(1000);
                }
            });
            doAll("sesDef","spu","errSPU");
            doAll("sesUn","spu","errSPU");
            doAll("conDef","ct","errCT");
            doAll("conUn","ct","errCT");
            doAll("idlDef","it","errIT");
            doAll("idlUn","it","errIT");
        });
    </script>
<jsp:useBean id="user" class="data.UserInfo" scope="session"/>
<div id="header">
    	<div class="mainLogo">
            <div class="logo style7">Information System Security </div>
            <div class="author">
              <p class="style8">&nbsp;</p>
              <p class="style8">&nbsp;</p>
              <p class="style8">AUTHOR : GROUP 1</p>
            </div>
        </div>
        <div class="icons">
        	<a href=""></a>&nbsp;<a href=""></a>        </div>
        <div id="navcontainer">
            <ul id="navlist">
                <li><a href="UserInfo.jsp">HOME</a></li>
                <li class="menuSeparator"><img src="images/menuSeparator.png" alt="" /></li>
                <li id="active"><a href="profileList.jsp">PROFILE </a></li>
                <li class="menuSeparator"><img src="images/menuSeparator.png" alt="" /></li>
                <li><a href="Role.jsp">ROLE</a></li>
                <li class="menuSeparator"><img src="images/menuSeparator.png" alt="" /></li>
                <li><a href="Table.jsp">TABLE</a></li>
                <li class="menuSeparator"><img src="images/menuSeparator.png" alt="" /></li>
                <li><a href="Contact.html">CONTACT</a></li>
            </ul>
        </div>
    
<div id="Header">
  <div id="HelloUser">
      <div align="right">
          Hello <jsp:getProperty name="user" property="username"/>!
          <br>
          <a href="index.jsp">Sign out</a>      </div>
  </div>
</div>
<br/><br/>
 <div id="tabsG">
                                <ul>
                                        <!-- CSS Tabs -->
<li><a href="createProfile.jsp"><span>Create profile</span></a></li>
<li><a href= "profileList.jsp"><span>Modify/Drop</span></a></li>

                                </ul>
  </div>
                <br /><br />
</div>
<br />
<br />
<form id="form1" name="form1" method="post" action="profile_Create">
<table width="498"  border="0" align="center" cellpadding="1" cellspacing="1" class = "Table">
  <tr>
    <td colspan="2"><div align="center" class="style13">
      <p class="style15">CREATE NEW PROFILE </p>
      <p class="style15">&nbsp;</p>
    </div></td>
  </tr>
  <tr>
    <td height="29"><span class="style13">Name</span></td>
    <td><span class="style14">
      <input class="field" name="name" type="text" id="name" />
      
      <input name="radiobutton" type="radio" />
Default
<input name="radiobutton" type="radio" />
Unlimited</span></td>
    </tr>
  <tr>
    <td width="118" height="29">
        <span class="style14"><strong>Session_per_user</strong> </span></td>
    <td>
      <span class="style14">
      <input class="field" name="spu" type="text" id="spu" />
      </span>
          
      <span class="style4 style14">
          <input id ="sesDef" name="session" type="radio" value ="DEFAULT"/>
          Default
          <input id="sesUn" name="session" type="radio" value="UNLIMITED" />
      Unlimited      </span> 
      
      </td>
  </tr>
  <tr>
    <td height="28"><span class="style14"><strong>Connect_time</strong></span></td>
    <td>
        <span class="style14">
        <input class="field" name="ct" type="text" id="ct" />
        </span>
            
        <span class="style4 style14">
            <input id="conDef" name="connect" type="radio" value ="DEFAULT"/>
            Default
            <input id="conUn" name="connect" type="radio" value="UNLIMITED"/>
        Unlimited        </span> 
        <div class ="red noneDisplay style14" id="errCT">Wrong type of Connect_time(number only)</div>
      </td>
  </tr>
  <tr>
    <td height="27"><span class="style14"><strong>Idle_time </strong></span></td>
    <td>
        <span class="style14">
        <input class="field" name="it" type="text" id="it" />
        </span>
            
        <span class="style4 style14">
          <input id="idlDef" name="idle" type="radio" value ="DEFAULT"/>
        Default
        <input id="idlUn" name="idle" type="radio" value="UNLIMITED"/>
        Unlimited        </span>
        
      </td>
        <td>
        <div class ="red noneDisplay style14" id="errIT">Wrong type of Idle_time(number only)</div> 
        </td>
  </tr>
  <tr>
    <td height="23" colspan="2" align="center" valign="middle" >
        <p align="left">&nbsp;        </p>
        <p align="center">
          <input type="submit" name="Submit" value="Submit" class ="button"/>    
        </p></td>
  </tr>
</table>
<div class ="red noneDisplay style14" id="errSPU">Wrong type of Session_per_user(number only)</div>
<div id="Layer6"></div>
<div id="Layer4"></div>
</form>      
</body>
</html>